1. Field of the Invention
The present invention relates to an image processing apparatus and method to perform the process by receiving a drawing instruction output, for example, from an image generating apparatus and particularly by receiving a drawing instruction including a designation for logical arithmetic process between pixels forming an image.
2. Description of the Related Art
In an image forming system in which various drawing instructions output from an image generating apparatus such as a personal computer are processed and these instructions are developed to image data expressed by arrangement of pixels to be printed by a printing device, various processes are performed depending on the drawing instruction while such drawing instructions are received and then developed to image data. It is one of the processes to overlap both images depending on the instruction of the method for overlapping an image to be newly written on the old image on the occasion of drawing a plurality of images at the overlapping position. The image overlapping method to-be instructed is generally instructed as a kind of the logical arithmetic processes such as logical sum, logical product and exclusive original sum. Such logical arithmetic process between images is generally known as ROP (Raster operation).
The ROP process is generally complicated and requires a longer processing time and also requires many memories for execution. Particularly, in order to express only one effect, many application programs exist in order to output a command combining a plurality of ROP processes. Instruction combining such ROP processes has been a factor for increasing the processing time required until an image is printed by the printing device.
Usually, 16 to 256 kinds of ROP processes are provided. However, these ROP processes are not always used in general and the limited kinds of processes are often used depending on the characteristic combination by the application programs.
As an example of combination of the ROP processes, the process to completely paint the internal side of the desired shape with gradation may be listed by the ROP process of three steps. In the step 1 of this process, the original pixels in the rectangular shape area including the desired shape and total painting pattern of gradation are calculated through the ROP process of exclusive sum (XOR) and are drawn as the pixels of target area. In the next step 2, white and black mask pattern indicating the desired shape and pixels of the target area are calculated by the ROP process of the logical product (AND) and are drawn as the pixels of the target area. As a result, the internal side of the desired shape may be replaced with the black pixels of the mask pattern, while the external side is expressed by logical sum with the white pixels. As a result, the external side remains as the original pixel values. In the final step 3, the pixels of the same rectangular shape as the step 1 and the complete painting pattern of gradation are calculated again by the ROP process of the exclusive logical sum (XOR) and are drawn as the pixels of the target area. As a result, the part completely painted by black in the step 2, namely the internal side of the desired shape is completely painted by the gradation pattern as the first object and the external side is returned to the condition before starting the ROP process in the step 3.
In order to completely paint the internal side of the desired shape as explained above with the particular pattern, the ROP process must be executed for three times in total. Therefore, considerable processing time is required. Therefore, as is described in the Japanese Published Unexamined Patent Application No. Hei 8-263674, it is thought that the characteristic pattern of such ROP process is detected, the number of steps of ROP process is reduced and such process is replaced with more simplified ROP process. In the method disclosed in this reference, the first step among the ROP process of three steps is completely omitted and the mask pattern of the step 2 and gradation pattern of step 3 are previously subjected to the logical product and the result is then written to the target area. Thereby, the number of times of the ROP process can be reduced to realize high speed process.
In the example explained above, high speed process has been realized by avoiding the step 1 among the ROP process of three steps, but the ROP process is also executed as is determined. Moreover, combination pattern of the other ROP processes is not described and high speed operation is also expected for the other combination of the ROP processes.
Meanwhile, the ROP process explained above has been thought for display on the display unit of a personal computer and the pixel data as the object of the logical arithmetic process is based on expression in the RGB color space. In an ordinary printing device, the CMYK color space is finally used and it is different from a color space on which the ROP process is based. The ROP process cannot be executed correctly in the color space in which the K color element is not primarily independent, depending on the other C, M, Y color element as in the case of the CMYK color space. Therefore, when the ROP process is executed for the pixels expressed by the CMYK color space, the result which is different from that obtained when such ROP process is executed to the pixels in the RGB color space can be obtained.
Accordingly, as a method of executing in correct the ROP process, the ROP process is executed, for example, while the image data expressed in the RGB color space is developed first to the pixel data while it is the RGB color space. The image data in a page is all developed to the image data and after the ROP process is completed, all pixels in one page are converted at a time to the CMYK color space. However, in this method, the pixel data expressed in the RGB color space must be color-converted to the pixels in the CMYK color space in unit of pixel. As a result, much processing time is required for color conversion. Moreover, since uniform color conversion is executed not depending on a kind of image data expressed by the original drawing command, color conversion parameter suitable for a kind of pixel data cannot be selected and thereby a problem of image quality may also be generated.
For the method explained above, also considered is the method where the image data developed to the pixel data in the CMYK color space is converted in the CMY color space or RGB color space as much as required for ROP process, thereafter the ROP process is executed and only the part converted in the CMY color space or RGB color space is converted again in the CMYK color space. According to this method, higher speed process can be expected in comparison with the conversion of the pixels in the CMYK color space once developed in the RGB space as explained above. Moreover, correct ROP process may be enabled in comparison with the direct process in the CMYK color space. However, since conversion to the CMY color space or RGB color space from the CMYK color space is not conducted in one to one basis and color value after the conversion is never determined uniquely. Therefore, even when the part which is once converted to the CMY color space or RGB color space for the ROP process is converted again to the CMYK color space, the pixel value is not always returned to the original value. Therefore, in some cases, color difference may be generated, when conversion is conducted again to the CMYK color space after the ROP process, at the area between the part where the ROP process is executed and its peripheral part where the ROP process is not yet executed.
As explained above, discrepancy on color reproduction may be generated, when the ROP process is executed, in some cases due to the color conversion process followed by the ROP process. In order to avoid such discrepancy, it is requested to avoid the ROP process as much as possible.
Considering the background explained above, an object of the present invention is to provide an image processing apparatus and method that enable high speed and high quality image drawing process.
The present invention is characterized in determining whether the drawing logical arithmetic process instruction in the drawing instruction has the content which may be processed or not without execution of the logical arithmetic process and converting one or a plurality of continuous drawing logical arithmetic process instruction and drawing objects having the content which may be processed without logical arithmetic process into the instruction and drawing object which do not require the drawing logical arithmetic process. Therefore, since it is no longer required to execute unnecessary drawing logical arithmetic process, high speed and high image quality drawing process may be enabled.